//simplification is elimination of contour's nodes
#pragma once

#include "outline.h"

namespace outline {

///simplification of single outline
///\param it is acceptable for src and dst to coincide
///\return measure of discrepancy between nodes of source outline and simplified outline
template <typename T>
double simplify_min_step_len(int min_step_len,
	std::vector< point<T> > const & src, std::vector< point<T> > & dst);

///simplification of multiple outlines
///\param it is acceptable for src and dst to coincide
///\return summed measure of discrepancy between nodes of source outlines and simplified outlines
template <typename T>
double simplify_min_step_len(int min_step_len,
	std::vector<std::vector<point<T> > > const & src, std::vector<std::vector<point<T> > > & dst);

///exactly K nodes in contour is leaved
template <typename T>
double simplify_to_K_nodes(int K,
	std::vector< point<T> > const & src, std::vector< point<T> > & dst);

template <typename T>
double simplify_avg_step_len(float avg_step_len,
	std::vector<std::vector<point<T> > > const & src, std::vector<std::vector<point<T> > > & dst);

///(minimal number of nodes is leaved providing error less than given argument)
template <typename T>
double simplify_max_discrepancy(double max_discrepancy,
	std::vector< point<T> > const & src, std::vector< point<T> > & dst);

///avg_discrepancy is total discrepancy divided by node count in source contours
template <typename T>
double simplify_avg_discrepancy(double avg_discrepancy,
	std::vector<std::vector<point<T> > > const & src, std::vector<std::vector<point<T> > > & dst);

} //namespace outline
